#include "packet.h"
#include "message_header.h"

void handle_incoming_message(struct message_header* header, unsigned char* payload) {
    if (header->scope == PACKET_SCOPE_GLOBAL && header->delivery == PACKET_DELIVERY_SYNC) {
    } else if (header->scope == PACKET_SCOPE_GLOBAL && header->delivery == PACKET_DELIVERY_ASYNC) {
    } else if (header->scope == PACKET_SCOPE_DEVICE_SPECIFIC && header->delivery == PACKET_DELIVERY_SYNC) {
    } else if (header->scope == PACKET_SCOPE_DEVICE_SPECIFIC && header->delivery == PACKET_DELIVERY_ASYNC) {
    } else() {
    }

}

void handle_sync_global_message(uint16_t message_number, unsigned char* payload) {
}

void handle_async_global_message(uint16_t message_number, unsigned char* payload) {
    // Check for message number <= sync_msg_handlers.size
    sync_msg_handler handler = sync_msg_handlers[message_number];
}

voiad handle_sync_device_message(uint16_t message_number, unsigned char* payload) {
}

void handle_get_acc_reading_internal(void* request, void* reply) {
    get_acc_reading_req* req_stru = (get_acc_reading_req*) request;
    // TODO: network->host

    get_acc_reading_rpl* rpl_stru = (get_acc_reading_rpl*) request;
    handle_get_acc_reading(req_stru, rpl_stru);
    rpl_stru->reading_x = hbo2nbo16(rpl_stru->reading_x);

}

void handle_get_acc_reading(get_acc_reading_req* request, get_acc_reading_rpl* reply) {
    
} 
